<template>
    <div class="app">
        <p>我是App组件(祖),{{name}}-{{price}}</p>
        <Child></Child>
    </div>
</template>

<script>
import { provide, reactive, toRefs } from 'vue'
import Child from './components/Child.vue'
export default {
    name: 'App',
    components: {Child},
    setup(){
        let car = reactive({name:'奔驰',price: '40W'})
        provide('car',car)
        return{...toRefs(car)}
    }
}
</script>

<style>
.app{
    background-color: gray;
    padding: 10px;
}
</style>